﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Contoso.Workflow.IManagement;
using Contoso.Workflow.Factory;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        IUser user = ManagementFactory.CreateUser(Session);
        string currentUser = user.GetCurrentUserId();
        if (currentUser != null)
        {
            lblCurrentUser.Text = "当前登录用户为" + currentUser;
        }
        else
        {
            lblCurrentUser.Text = "没有用户登录";
            //string currentPage = Request.Url.AbsolutePath.Substring(Request.Url.AbsolutePath.LastIndexOf("/") + 1);

            //if (currentPage.ToLower() != "login.aspx")
            //{
            //    Response.Redirect(@"login.aspx");
            //}
            
        }
    }
}
